#include	<stdio.h>
#include	<stdint.h>
#include	<string.h>
#include	<stdbool.h>


#ifndef MAVLINK_MESSAGE_LENGTHS
#define MAVLINK_MESSAGE_LENGTHS {6, 35, 113, 2, 2, 97, 12, 14, 6, 22, 64, 44, 36, 12, 16, 254, 9, 84, 64, 44, 62, 32, 20, 32, 32, 26, 33, 42, 56, 28, 51, 53, 51, 53, 37, 39, 22, 3, 33, 35, 20, 37, 18, 11, 4, 6, 42, 229, 185, 26, 68, 25, 27, 37, 12, 13, 3, 2, 2, 4, 2, 2, 4, 4, 37, 6, 6, 21, 22, 22, 28, 28, 32, 28, 14, 16, 26, 22, 101, 30, 23, 25, 2, 20, 6, 32, 3, 28, 14, 12, 31, 9, 0, 81, 0, 0, 0, 0, 0, 0, 79, 35, 35, 22, 13, 255, 14, 18, 43, 8, 22, 14, 36, 43, 41, 32, 243, 14, 100, 36, 60, 30, 32, 52, 53, 6, 2, 38, 254, 36, 30, 18, 18, 51, 9, 154, 128, 12, 28, 133, 9, 11, 2, 1, 113, 54, 80, 61, 52, 57, 20, 24, 33, 26, 14, 25, 30, 153, 77, 48, 167, 32, 33, 104, 49, 72, 68, 156, 14, 150, 6, 5, 41, 17, 186, 64, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
#endif

#ifndef MAVLINK_MESSAGE_CRCS
#define MAVLINK_MESSAGE_CRCS {204, 88, 251, 204, 238, 135, 117, 57, 129, 78, 5, 238, 125, 175, 35, 85, 186, 33, 109, 139, 94, 57, 209, 159, 103, 176, 55, 64, 184, 232, 151, 6, 141, 144, 23, 50, 107, 144, 153, 159, 21, 39, 125, 244, 22, 149, 119, 60, 52, 184, 154, 4, 16, 79, 40, 42, 154, 12, 233, 222, 133, 29, 29, 231, 1, 10, 213, 223, 245, 238, 105, 186, 247, 40, 116, 68, 145, 171, 24, 25, 169, 221, 160, 215, 90, 120, 105, 218, 238, 138, 125, 51, 0, 48, 0, 0, 0, 0, 0, 0, 221, 26, 227, 47, 30, 224, 86, 7, 230, 204, 2, 196, 110, 169, 182, 48, 73, 132, 104, 155, 179, 201, 91, 105, 86, 96, 131, 159, 9, 205, 50, 171, 45, 84, 47, 249, 215, 79, 146, 85, 10, 143, 217, 70, 127, 52, 3, 133, 128, 245, 20, 38, 141, 74, 104, 73, 108, 83, 11, 85, 103, 205, 191, 244, 12, 238, 139, 114, 222, 146, 138, 125, 158, 4, 106, 224, 93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
#endif

uint8_t crc_table[] = MAVLINK_MESSAGE_CRCS;
uint8_t len_table[] = MAVLINK_MESSAGE_LENGTHS;

int mavlink_main(int argc, char**argv)
{    

     // printf("adc_buf : 0x%x\r\n", adc_buf);
     // printf("(uint32_t)adc_buf: 0x%x\r\n", (uint32_t)adc_buf);
     // printf("(uint32_t*)&adc_buf: 0x%x\r\n", (uint32_t*)&adc_buf);
     // printf("(uint32_t*)&adc_buf[0]: 0x%x\r\n", (uint32_t*)&adc_buf[0]);
     // printf("(uint8_t*)&adc_buf: 0x%x\r\n", (uint8_t*)&adc_buf);
     // printf("(uint8_t*)adc_buf: 0x%x\r\n", (uint8_t*)adc_buf);
     
     uint8_t id = 164;
     printf("ID: %d\t,crc:%d, len: %d\r\n", id, crc_table[id], len_table[id]);
     id = 165;
     printf("ID: %d,crc:%d, len: %d\r\n", id, crc_table[id], len_table[id]);
     id = 166;

	return 0;
}
